package br.com.intelsys.basics.spring;

import java.io.IOException;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.view.RedirectView;

public class RedirView extends RedirectView {

	public RedirView(String url) {
		super(url);
	}

	protected void renderMergedOutputModel(Map<String, Object> model, HttpServletRequest request, HttpServletResponse response)
			throws IOException {
		IPageInfo pi = (IPageInfo) request.getAttribute("pi");
		System.out.println("000000000000000");
		if (pi != null) {
			System.out.println("111111111");
			List<String> msgList = pi.getMsgList();
			System.out.println("22222222222 " + msgList);
			if (msgList != null && msgList.size() > 0) {
				System.out.println("333333333333");
				request.getSession().setAttribute("msgList", msgList);
			}
		}
		super.renderMergedOutputModel(model, request, response);
	}
}
